﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.world {
    import net.wooga.pets.events.*;
    import net.wooga.pets.interfaces.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.models.world.*;

    public class PatientSpeechBubbleUpdateCommand extends Command {

		[Inject]
        public var event:InfoEvent;
		[Inject]
        public var world:WorldModel;

        override public function execute():void{
            var _local2:String;
            var _local1:ITreatable = (this.world.getActor(this.event.id) as ITreatable);
            if (_local1){
                if (((_local1.currentTreatment) && (!((_local1.state == WorldConstants.ILL))))){
                    _local2 = (SpeechBubbleConstants.ICON_TREATMENT + _local1.currentTreatment.roomType);
                    _local1.showSpeechBubble(SpeechBubbleConstants.TYPE_ICON_BUBBLE, {icon:_local2});
                } else {
                    _local1.removeSpeechBubble();
                };
            };
        }

    }
}//package net.wooga.pets.controllers.world 
